/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
using System;
using System.Collections.Generic;

using Aliyun.Acs.Core.Transform;
using Aliyun.Acs.polardbx.Model.V20200202;

namespace Aliyun.Acs.polardbx.Transform.V20200202
{
    public class DescribeBackupSetListResponseUnmarshaller
    {
        public static DescribeBackupSetListResponse Unmarshall(UnmarshallerContext _ctx)
        {
			DescribeBackupSetListResponse describeBackupSetListResponse = new DescribeBackupSetListResponse();

			describeBackupSetListResponse.HttpResponse = _ctx.HttpResponse;
			describeBackupSetListResponse.Message = _ctx.StringValue("DescribeBackupSetList.Message");
			describeBackupSetListResponse.RequestId = _ctx.StringValue("DescribeBackupSetList.RequestId");
			describeBackupSetListResponse.Success = _ctx.BooleanValue("DescribeBackupSetList.Success");

			List<DescribeBackupSetListResponse.DescribeBackupSetList_BackupSet> describeBackupSetListResponse_data = new List<DescribeBackupSetListResponse.DescribeBackupSetList_BackupSet>();
			for (int i = 0; i < _ctx.Length("DescribeBackupSetList.Data.Length"); i++) {
				DescribeBackupSetListResponse.DescribeBackupSetList_BackupSet backupSet = new DescribeBackupSetListResponse.DescribeBackupSetList_BackupSet();
				backupSet.EndTime = _ctx.LongValue("DescribeBackupSetList.Data["+ i +"].EndTime");
				backupSet.Status = _ctx.IntegerValue("DescribeBackupSetList.Data["+ i +"].Status");
				backupSet.BackupSetSize = _ctx.LongValue("DescribeBackupSetList.Data["+ i +"].BackupSetSize");
				backupSet.BackupSetId = _ctx.LongValue("DescribeBackupSetList.Data["+ i +"].BackupSetId");
				backupSet.BackupType = _ctx.IntegerValue("DescribeBackupSetList.Data["+ i +"].BackupType");
				backupSet.BeginTime = _ctx.LongValue("DescribeBackupSetList.Data["+ i +"].BeginTime");
				backupSet.BackupModel = _ctx.IntegerValue("DescribeBackupSetList.Data["+ i +"].BackupModel");

				describeBackupSetListResponse_data.Add(backupSet);
			}
			describeBackupSetListResponse.Data = describeBackupSetListResponse_data;
        
			return describeBackupSetListResponse;
        }
    }
}
